package com.jar.exercise.算法.归并排序;

import java.util.Arrays;

public class Demo {
    public static void main(String[] args) {
        int[] arr = {2, 3, 4, 5, 7, 1, 2, 7, 3, 1};
        sort(arr, 0, arr.length);
        System.out.println(Arrays.toString(arr));
    }

    private void merge(int[] arr, int a, int b) {
        int[] newArr = new int[arr.length * 2];
/*
        for (int i = 0; i < arr.length; i++) {
            int temp;
            if (arr[i] > arr[i + 1]) {
                temp = arr[i + 1];
                arr[i + 1] = arr[i];
                arr[i] = temp;
            }
        }
*/
    }

    private static void sort(int[] arr, int a, int b) {
        int middle = (a + b) / 2;
        if (a < b) {
            sort(arr, a, middle);
            sort(arr, middle + 1, b);
        }
    }
}
